import { dictcodes } from '../../basicData/serviceOrg/config'

export const searchConfig = (RegionId: number | string, authArea?: string | number) => {
	let areaColumn = []
	if (!RegionId) {
		areaColumn = [
			{
				label: '所属地区',
				prop: 'areas',
				type: 'AplidAreaSelect',
				administrationPid: authArea,
				span: 6,
			},
		]
	}
	return {
		inline: true,
		showBtn: true,
		labelPosition: 'left',
		column: [
			{
				label: '信用代码',
				prop: 'creditCode',
				type: 'input',
				span: 6,
			},
			{
				label: '机构名称',
				prop: 'organizationName',
				type: 'input',
				span: 6,
			},
			{
				label: '联系人',
				prop: 'burdenUserName',
				type: 'input',
				span: 6,
			},
			{
				label: '联系方式',
				prop: 'burdenUserPhone',
				type: 'input',
				span: 6,
			},
			...areaColumn,
			// {
			// 	label: '机构类型',
			// 	prop: 'organizationType',
			// 	type: 'remoteSelect',
			// 	code: 'ORG_TYPE',
			// 	api: 'getDictItemList',
			// 	filterKey: 'value',
			// 	multiple: false,
			// 	span: 6,
			// },
			{
				label: '机构星级',
				prop: 'organizationLevel',
				type: 'remoteSelect',
				code: 'ORG_LEVEL',
				api: 'getDictItemList',
				filterKey: 'label',
				multiple: false,
				span: 6,
			},
			// {
			// 	label: '运营状态',
			// 	prop: 'operateStatus',
			// 	changeField: true,
			// 	type: 'remoteSelect',
			// 	code: 'ORG_OPERATE_STATUS',
			// 	api: 'getDictItemList',
			// 	filterKey: 'value',
			// 	multiple: false,
			// 	span: 6,
			// },
		],
	}
}
export const tableConfig = {
	stripe: true,
	border: true,
	columns: [
		{ label: '机构名称', prop: 'organizationName' },
		{ label: '所属街道', prop: 'streetName' },
		{ label: '负责人', prop: 'burdenUserName' },
		{ label: '联系方式', prop: 'burdenUserPhone' },
		{
			label: '机构评定星级',
			prop: 'organizationLevel',
		},
		{ label: '消息通知数量', prop: 'noticeNum' },
		{ label: '更新完成率', prop: 'noticeChangeCompleteRate' },
		{
			label: '操作',
			prop: 'menu',
			width: 300,
			fixed: 'right',
		},
	],
}

export const api = {
	index: 'view_dpSubsidyStatistics_page',
}
export const baseConfig = {
	pageName: '消息通知',
	dictcodes,
	rowKey: 'id',
	addLabel: '新增',
	tipLabel: 'roleName',
	exportMqTopic: '/ning/export/',
	api,
	auth: {
		index: 'view_dpSubsidyStatistics_page',
	},
	menuBtn: [
		{
			icon: 'detail',
			label: '查看机构档案',
			type: 'primary',
			operate: 'detail',
			auth: '',
			text: true,
			show: true,
		},
	],
	dialogConfig: {
		width: '75%',
	},
	tableConfig,
}
